package actionStruts.advert;

import java.util.List;

import servise.TblAdvertAddressService;
import servise.advert.AdvertService;
import vo.advert.AdvertVo;

import com.opensymphony.xwork2.ActionSupport;

public class AdvertAction extends ActionSupport {
	private AdvertVo advertVo;
	private AdvertVo advertVoQuery;
	private String buttonFlagValue;
	private List<AdvertVo> advertVoList;
	private String[] selectedId;
	
	public String searchUptAdvert(){
		buttonFlagValue = "upt";
		AdvertService advertService = new AdvertService();
		advertVoQuery = advertService.uptTblAdvert(advertVo);
		return "searchUptAdvertSuccess";
		
	}
	public String deleteAdvert(){
		AdvertService advertService = new AdvertService();
		advertService.deleteAdvert(selectedId);
		return search();
	}
	public String search(){
		AdvertService advertService = new AdvertService();
		advertVoList = advertService.searchAdvert(advertVo);
		return "success";
	}
	public String execute(){
		
		return "success";
	
	}
	
	
	public AdvertVo getAdvertVo() {
		return advertVo;
	}
	public void setAdvertVo(AdvertVo advertVo) {
		this.advertVo = advertVo;
	}


	public List<AdvertVo> getAdvertVoList() {
		return advertVoList;
	}


	public void setAdvertVoList(List<AdvertVo> advertVoList) {
		this.advertVoList = advertVoList;
	}
	public String[] getSelectedId() {
		return selectedId;
	}
	public void setSelectedId(String[] selectedId) {
		this.selectedId = selectedId;
	}
	public AdvertVo getAdvertVoQuery() {
		return advertVoQuery;
	}
	public void setAdvertVoQuery(AdvertVo advertVoQuery) {
		this.advertVoQuery = advertVoQuery;
	}
	public String getButtonFlagValue() {
		return buttonFlagValue;
	}
	public void setButtonFlagValue(String buttonFlagValue) {
		this.buttonFlagValue = buttonFlagValue;
	}

}
